<?php

use Biz\service\BrandUser;
use Biz\service\NiceGoodsTopic\GoodList;

class GoodsListAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    public function main()
    {
        $topic_id = $this->getRequest()->getPost('id', 0);
        $page = $this->getRequest()->getPost('page', 1);
        if(empty($topic_id)){
            throw new \Exception("topic_id 不存在");
        }
        $result =   GoodList::getGoodsList($topic_id , $page);
        $this->setSuccess(['goods_list' =>$result , 'is_over' => count($result) < GoodList::PAGESIZE ? 1 : 0]);

    }
}